{extend name="base" /}
{block name="title"}<title>51王者快报-新闻资讯</title>{/block}
{block name="style"}
<link rel="stylesheet" href="__CSS__/news.css">
{/block}
{block name="body"}
<div class="news">

    {include file='common/header' /}
    <!-- banner -->
    <div class="bgbanner">
        <img src="{$bannerImgUrl}" width="100%">
    </div>
    <!-- new_con -->
    <div class="news_con">
        <div class="lewm news_l_con">
            <div class="lewn_title1">
                <img src="__IMG__/dowload.png"/>
                扫描二维码下载游戏
            </div>
            <img src="__IMG__/2.png"/>

            <a href="https://pvp.qq.com/zlkdatasys/mct/d/play.shtml?device=ios"><img class="new_pic1" src="__IMG__/AppStore.jpg"/></a>
            <a href="https://pvp.qq.com/zlkdatasys/mct/d/play.shtml?device=android"><img src="__IMG__/Android.jpg"/></a>
            <div class="lewn_box">
                <img src="__IMG__/gzh_code.jpg"/>
                <div class="lewn_b_right">
                    <span>王者荣耀<br>官方微信号</span>
                    <div class="jwqysy">heromoba</div>
                    <div class="lewn_help">客服热线</div>
                    <div class="lewn_help_phone">020-28125570</div>
                </div>
            </div>
        </div>
        <div class="tab">
            <div class="tab_dashed"></div>
            <div class="tab_news_title">新闻资讯</div>
            <img class="tab_new_line" src="__IMG__/new_title3.png"/>
            <ul class="nav_ul">
                <li data-id="1" class="lidom" style="color:#A53248">
                    最新
                    <img src="__IMG__/new_down.png" style="display:block" />
                </li>
                <li data-id="2" class="lidom">
                    爆料
                    <img src="__IMG__/new_down.png"/>
                </li>
                <li data-id="3" class="lidom">
                    公告
                    <img src="__IMG__/new_down.png"/>
                </li>
                <li data-id="4" class="lidom">
                    活动
                    <img src="__IMG__/new_down.png"/>
                </li>
                <li data-id="5" class="lidom">
                    攻略
                    <img src="__IMG__/new_down.png"/>
                </li>
            </ul>
            <div class="t_con t_con_active">
                <ul id="newList">

                       {volist name="zx" id="vo"}
                    <li>
                        <a>【最新】</a>&nbsp;<a href="/index/zx/index?id={$vo.id} ">{$vo.title}</a>
                        <span>{$vo.create_time}</span>
                    </li>
                    {/volist}

                        </ul>
            </div>
          <!--  <div class="t_con">
                <ul>
                    {volist name="bl" id="vo"}
                    <li>
                        <a>【爆料】</a>&nbsp;<a href="/index/zx/index?id={$vo.id} ">{$vo.title}</a>
                        <span>{$vo.create_time}</span>
                    </li>
                    {/volist}

                </ul>
            </div>
            <div class="t_con">
                <ul>
                    {volist name="gg" id="vo"}
                    <li>
                        <a>【公告】</a>&nbsp;<a href="/index/zx/index?id={$vo.id} ">{$vo.title}</a>
                        <span>{$vo.create_time}</span>
                    </li>
                    {/volist}
                </ul>
            </div>
            <div class="t_con">
                <ul>
                    {volist name="hd" id="vo"}
                    <li>
                        <a>【活动】</a>&nbsp;<a href="/index/zx/index?id={$vo.id} ">{$vo.title}</a>
                        <span>{$vo.create_time}</span>
                    </li>
                    {/volist}
                </ul>
            </div>
            <div class="t_con">
                <ul>
                    {volist name="gl" id="vo"}
                    <li>
                        <a>【攻略】</a>&nbsp;<a href="/index/zx/index?id={$vo.id} ">{$vo.title}</a>
                        <span>{$vo.create_time}</span>
                    </li>
                    {/volist}

                </ul>
                <div class="up_down">
                    <div class="up_down_left">上一页</div>
                    <div class="up_down_right">下一页</div>
                </div>
            </div>-->
            <div class="up_down" id="page" data-id="" data-type="">
                <div class="up_down_left">上一页</div>
                <div class="up_down_right">下一页</div>
            </div>
        </div>
    </div>
    <!-- footer -->
    {include file='common/footer' /}
</div>
</div>

{/block}
{block name="script"}
<script>
    $(function () {



        $('.up_down_left').on('click',function () {

            let page = $('#page').attr('data-id')
            let type = $('#page').attr('data-type')

            page--;

            if(page > 0){
                $.ajax({
                    url:'/index/news/type',
                    data:{id:type,page:page},
                    success:function (res) {
                        let data = res.list.data
                        let len = data.length
                        if(len >= 1){
                            $('#page').attr('data-id',res.page)
                            $('#page').attr('data-type',res.type)


                            console.log(len)


                            let htmlString = ''
                            for (let i = 0;i<len;i++){
                                htmlString += '<li><a href="/index/zx/index?id='+data[i].id+' ">'+data[i].title+'</a>'
                                htmlString += '<span>'+data[i].create_time+'</span></li>'
                            }
                            $('#newList').html(htmlString);
                        }
                    }
                })
            }

        })

        $('.up_down_right').on('click',function () {
            let page = $('#page').attr('data-id')
            let type = $('#page').attr('data-type')
            page++;

            $.ajax({
                url:'/index/news/type',
                data:{id:type,page:page},
                success:function (res) {
                    let data = res.list.data
                    let len = data.length
                    if(len >= 1){
                        $('#page').attr('data-id',res.page)
                        $('#page').attr('data-type',res.type)


                        console.log(len)


                        let htmlString = ''
                        for (let i = 0;i<len;i++){
                            htmlString += '<li><a href="/index/zx/index?id='+data[i].id+' ">'+data[i].title+'</a>'
                            htmlString += '<span>'+data[i].create_time+'</span></li>'
                        }
                        $('#newList').html(htmlString);
                    }

                }
            })

        })
    })
</script>
<script>
    // tab 
    function tabs() {
        $(".nav_ul li").click(function() {

           /* $(".t_con").hide();
            $(".t_con").eq($(this).index()).fadeIn(200);
            $(".nav_ul li img").hide();
            $(".nav_ul li img").eq($(this).index()).show();
            $(".nav_ul li").css("color","");
            $(".nav_ul li").eq($(this).index()).css("color",'#A53248');*/
            $(".nav_ul li img").hide();
            $(".nav_ul li img").eq($(this).index()).show();
            $(".nav_ul li").css("color","");
            $(".nav_ul li").eq($(this).index()).css("color",'#A53248')

            let id = $(this).attr('data-id');
            console.log(id)
            $.ajax({
                url:'/index/news/type',
                data:{id},
                success:function (res) {

                    $('#page').attr('data-id',res.page)
                    $('#page').attr('data-type',res.type)
                    let data = res.list.data
                    let len = data.length
                    let htmlString = ''
                    for (let i = 0;i<len;i++){

                        htmlString += '<li><a href="/index/zx/index?id='+data[i].id+' ">'+data[i].title+'</a>'
                        htmlString += '<span>'+data[i].create_time+'</span></li>'



                    }

                    $('#newList').html(htmlString);

                    //console.log(res)
                },
                error:function (res) {

                }
            })
        });
    }
    tabs();
</script>
{/block}